package com.sky.config;

import com.sky.properties.AliOssProperties;
import com.sky.utils.AliOssUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * packageName com.sky.config
 *
 * @author fenglai
 * @version JDK 11
 * @className AliOSSConfiguration
 * @date 2023/12/15
 * @description TODO
 */
@Configuration
public class AliOSSConfiguration {

    @Bean
    public AliOssUtil aliOssUtil(AliOssProperties aliOssProperties) {
        AliOssUtil aliOssUtil = new AliOssUtil();
        aliOssUtil.setEndpoint(aliOssProperties.getEndpoint());
        aliOssUtil.setBucketName(aliOssProperties.getBucketName());
        aliOssUtil.setAccessKeyId(aliOssProperties.getAccessKeyId());
        aliOssUtil.setAccessKeySecret(aliOssProperties.getAccessKeySecret());
        return aliOssUtil;
    }

}